<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Convert GMP number to string</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.gmp-strval" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmp_strval</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">gmp_strval</span> &mdash; <span class="dc-title">Convert GMP number to string</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.gmp-strval-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmp_strval</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.gmp.html" class="type GMP">GMP</a></span> <code class="parameter">$gmpnumber</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$base</code><span class="initializer"> = 10</span></span>
  ] ) : <span class="type">string</span></div>

  <p class="para rdfs-comment">
   Convert GMP number to string representation in base
   <code class="parameter">base</code>. The default base is 10.  
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gmp-strval-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">gmpnumber</code></dt>

     <dd>

      <p class="para">
       The GMP number that will be converted to a string.
      </p>
      <p class="para">可以是一个 GMP
数据 <span class="type"><span class="type resouce">resouce</span></span>，或一个可以转换为数值的字符串。</p> 
     </dd>

    
    
     <dt>
<code class="parameter">base</code></dt>

     <dd>

      <p class="para">
       The base of the returned number. The default base is 10. 
       Allowed values for the base are from 2 to 62 and -2 to -36.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.gmp-strval-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The number, as a <span class="type"><a href="language.types.string.html" class="type string">string</a></span>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.gmp-strval-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.3.2</td>
       <td>
        The <code class="parameter">base</code> was extended from 2 to 36, to
        2 to 62 and -2 to -36.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.gmp-strval-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    To use the extended base introduced in PHP 5.3.2, then 
    PHP must be compiled against GMP 4.2.0 or greater.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gmp-strval-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4105">
    <p><strong>Example #1 Converting a GMP number to a string</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"0x41682179fbf5"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Decimal:&nbsp;%s,&nbsp;36-based:&nbsp;%s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">,</span><span style="color: #0000BB">36</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>

</div></div></div></body></html>